home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d13 / pj9_3.arc / TESTATOM.ASM < prev    next >
Assembly Source File  |  1991-10-07  |  866b  |  62 lines

  1.     title    test atom
  2.     include    asm.inc
  3.  
  4.     public    main,mai1,mai2,mai3
  5.  
  6.     .stack
  7.  
  8.     .const
  9. numbers_txt    db    'one',0, 'two',0, 'three',0, 'four',0, 'ONE',0
  10.  
  11.  
  12.     .data?
  13. line        db    256 dup(?)
  14. atoms        dw    1024 dup(?)
  15.  
  16.  
  17.     .code
  18.     extn    startup,add_atom,init_atom_table,exit_program,perror,puts
  19.     extn    strskp,get_atom_name
  20.  
  21.  
  22. ;;    main
  23. ;
  24. main    proc
  25.     mov    ax,7
  26.     call    init_atom_table
  27.     jc    mai3
  28.  
  29.     mov    cx,5            ; add strings to atom table
  30.     lea    di,atoms
  31.     lea    si,numbers_txt
  32. mai1:    call    add_atom
  33.     jc    mai3
  34.     stosw
  35.     call    strskp
  36.     loop    mai1
  37.  
  38.     mov    dx,5            ; extract strings from atom table
  39.     lea    si,atoms
  40.     lea    di,line
  41.     mov    cx,size line
  42. mai2:    lodsw
  43.     call    get_atom_name
  44.     jc    mai3
  45.     mov    al,' '
  46.     stosb
  47.     dec    dx
  48.     jnz    mai2
  49.     mov    al,NULL_CHAR
  50.     stosb
  51.  
  52.     lea    si,line
  53.     call    puts
  54.     jmp    exit_program
  55.  
  56. mai3:    mov    si,NULL_POINTER
  57.     call    perror
  58.     jmp    exit_program
  59. main    endp
  60.  
  61.     end
  62.